<template>
    <div id="userLayout" :class="['user-layout-wrapper']">
        <div class="container">
            <div class="wrap-mask"></div>
            <div class="user-layout-content">
                <div class="top">
                    <div class="header">
                        <a href="/">
                            <span class="title">产品管理平台</span>
                        </a>
                    </div>
                </div>
                <router-view />
            </div>
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, onBeforeUnmount } from 'vue';
export default defineComponent({
    name: 'UserLayout',
    setup() {
        onMounted(() => {
            document.body.classList.add('userLayout');
        });
        onBeforeUnmount(() => {
            document.body.classList.remove('userLayout');
        });
    }
});
</script>

<style lang="less" scoped>
#userLayout.user-layout-wrapper {
    height: 100%;
    .container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-height: 100%;
        background: url(@/assets/images/bg-login.jpg) no-repeat;
        background-size: 100% 100%;
        background-origin: content-box;
        position: relative;

        .wrap-mask:after {
            position: absolute;
            top: 0;
            left: 0;
            content: '';
            background-color: rgba(0, 0, 0, 0.5);
            opacity: 0.2;
            z-index: 1;
            width: 100%;
            height: 100%;
        }

        .user-layout-content {
            z-index: 2;
            // @media (min-width: 768px) {
            //     padding: 116px 0 10px;
            // }
            .top {
                text-align: center;
                .header {
                    margin-top: -100px;
                    height: 100px;
                    line-height: 100px;
                    .title {
                        font-size: 28px;
                        color: #fff;
                        font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
                        font-weight: 600;
                        position: relative;
                        top: 6px;
                    }
                }
            }
            .main {
                width: 368px;
                margin: 0 auto;
                @media screen and (max-width: 576px) {
                    width: 95%;
                }
                @media screen and (max-width: 320px) {
                    .captcha-button {
                        font-size: 14px;
                    }
                }
            }
        }
        a {
            text-decoration: none;
        }
    }
}
</style>
